Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GAP.Packages.versioninfo() #1119

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

ThomasBreuer
Copy link
Member

@ThomasBreuer ThomasBreuer commented Jan 7, 2025

Resolves #1082

With this code, I get the following output after using Oscar.

julia> GAP.Packages.versioninfo()
GAP version 4.14.0
GAP packages:
  aclib           1.3.2       ARTIFACTS/e91708d.../aclib-1.3.2
  alnuth          3.2.1       ARTIFACTS/af2c63b.../alnuth-3.2.1
  atlasrep        2.1.9       ARTIFACTS/eac0e07.../atlasrep-2.1.9
  autodoc         2023.06.19  ARTIFACTS/f36c330.../AutoDoc-2023.06.19
  autpgrp         1.11        ARTIFACTS/dbf049a.../autpgrp-1.11
  browse          1.8.21      ARTIFACTS/840bdaf.../Browse-1.8.21
  caratinterface  2.3.7       ARTIFACTS/13ed4fe.../CaratInterface
  crisp           1.4.6       ARTIFACTS/587a445.../crisp-1.4.6
  cryst           4.1.27      ARTIFACTS/6bf4041.../cryst
  crystcat        1.1.10      ARTIFACTS/7711ad1.../crystcat
  ctbllib         1.3.9       ARTIFACTS/d44e344.../ctbllib-1.3.9
  curlinterface   2.4.0       ARTIFACTS/b8a06a6.../curlInterface-2.4.0
  factint         1.6.3       ARTIFACTS/9c82af7.../FactInt-1.6.3
  ferret          1.0.14      ARTIFACTS/e12158f.../ferret-1.0.14
  fga             1.5.0       ARTIFACTS/cd44c5b.../fga-1.5.0
  forms           1.2.12      ARTIFACTS/f8b96df.../forms-1.2.12
  gapdoc          1.6.7       ARTIFACTS/4713f02.../GAPDoc-1.6.7
  genss           1.6.9       ARTIFACTS/3bd5aa8.../genss-1.6.9
  guava           3.19        ARTIFACTS/d0c29f2.../guava-3.19
  io              4.9.1       ARTIFACTS/d502c7d.../io-4.9.1
  irredsol        1.4.4       ARTIFACTS/a9f1d45.../irredsol-1.4.4
* juliainterface  0.13.0-DEV  /export/home/sam/julia/packages/GAP.jl/pkg/JuliaInterface
  laguna          3.9.7       ARTIFACTS/8497297.../laguna-3.9.7
  orb             4.9.1       ARTIFACTS/d2699bc.../orb-4.9.1
* oscarinterface  1.3.0-DEV   /export/home/sam/julia/packages/Oscar.jl/gap/OscarInterface
  packagemanager  1.6         ARTIFACTS/da27160.../PackageManager-1.6
  polenta         1.3.10      ARTIFACTS/1c64565.../polenta-1.3.10
  polycyclic      2.16        ARTIFACTS/19ffad5.../polycyclic-2.16
  primgrp         3.4.4       ARTIFACTS/f21a1e0.../primgrp-3.4.4
  radiroot        2.9         ARTIFACTS/320d3c9.../radiroot-2.9
  recog           1.4.3       ARTIFACTS/e6cd9b6.../recog-1.4.3
  repsn           3.1.2       ARTIFACTS/94e5135.../repsn-3.1.2
  resclasses      4.7.3       ARTIFACTS/9cc64af.../resclasses-4.7.3
  smallgrp        1.5.4       ARTIFACTS/051592b.../SmallGrp-1.5.4
  sonata          2.9.6       ARTIFACTS/d31bd16.../sonata-2.9.6
  sophus          1.27        ARTIFACTS/4c406cd.../sophus-1.27
  spinsym         1.5.2       ARTIFACTS/9949383.../spinsym-1.5.2
  standardff      1.0         ARTIFACTS/28827b6.../StandardFF-1.0
  tomlib          1.2.11      ARTIFACTS/5cbbd05.../tomlib-1.2.11
  transgrp        3.6.5       ARTIFACTS/0308e77.../transgrp
  utils           0.85        ARTIFACTS/d43af8a.../utils-0.85
  wedderga        4.10.5      ARTIFACTS/4fec3f3.../wedderga-4.10.5

Would it make sense to show also the version of the jll package if applicable?
(Remove the comment signs in the new code in order to see the result.)
If yes then it would make sense to show two lines per package.

@ThomasBreuer ThomasBreuer added the kind: enhancement New feature or request label Jan 7, 2025
@ThomasBreuer ThomasBreuer requested a review from fingolfin January 7, 2025 22:25
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.58%. Comparing base (bbdbe2b) to head (1e74371).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1119      +/-   ##
==========================================
- Coverage   75.27%   74.58%   -0.70%     
==========================================
  Files          55       55              
  Lines        4668     4713      +45     
==========================================
+ Hits         3514     3515       +1     
- Misses       1154     1198      +44     
Files with missing lines Coverage Δ
src/GAP.jl 86.77% <100.00%> (+0.56%) ⬆️
src/packages.jl 49.77% <100.00%> (+11.09%) ⬆️

... and 2 files with indirect coverage changes

@lgoettgens
Copy link
Member

Looks nice!
I would indeed expect to see some information about the jlls (if applicable). And I found it a bit unexpected to have GAP.Packages.versioninfo print the GAP version (ie something about GAP itself, and not a package), but this may just be a personal thing.

@ThomasBreuer
Copy link
Member Author

And I found it a bit unexpected to have GAP.Packages.versioninfo print the GAP version (ie something about GAP itself, and not a package)

My point of view is that GAP.Packages is a module of GAP.jl, and GAP itself is a package used by GAP.jl.
If this is too confusing then perhaps the function should be moved away from GAP.Packages, and one should call GAP.versioninfo().
If we leave out the information about the GAP version then what is the recommended way to show it?

@fingolfin
Copy link
Member

I would vote for GAP.versioninfo as that's a bit briefer to type and thus to get users to enter (that's for me the main application: when helping to debug a user's problem, ask them to report the output of GAP.versioninfo() )

@ThomasBreuer
Copy link
Member Author

Concerning the jll information:
After removing the relevant comment signs in the code, I get the following.

julia> GAP.Packages.versioninfo()
GAP version 4.14.0
GAP packages:
  aclib           1.3.2                        ARTIFACTS/e91708d.../aclib-1.3.2
  alnuth          3.2.1                        ARTIFACTS/af2c63b.../alnuth-3.2.1
  atlasrep        2.1.9                        ARTIFACTS/eac0e07.../atlasrep-2.1.9
  autodoc         2023.06.19                   ARTIFACTS/f36c330.../AutoDoc-2023.06.19
  autpgrp         1.11                         ARTIFACTS/dbf049a.../autpgrp-1.11
  browse          1.8.21      v100.800.2101+1  ARTIFACTS/840bdaf.../Browse-1.8.21
  caratinterface  2.3.7       v200.300.701+0   ARTIFACTS/13ed4fe.../CaratInterface
  crisp           1.4.6                        ARTIFACTS/587a445.../crisp-1.4.6
  cryst           4.1.27                       ARTIFACTS/6bf4041.../cryst
  crystcat        1.1.10                       ARTIFACTS/7711ad1.../crystcat
  ctbllib         1.3.9                        ARTIFACTS/d44e344.../ctbllib-1.3.9
  curlinterface   2.4.0       v200.400.0+0     ARTIFACTS/b8a06a6.../curlInterface-2.4.0
  factint         1.6.3                        ARTIFACTS/9c82af7.../FactInt-1.6.3
  ferret          1.0.14      v100.0.1400+1    ARTIFACTS/e12158f.../ferret-1.0.14
  fga             1.5.0                        ARTIFACTS/cd44c5b.../fga-1.5.0
  forms           1.2.12                       ARTIFACTS/f8b96df.../forms-1.2.12
  gapdoc          1.6.7                        ARTIFACTS/4713f02.../GAPDoc-1.6.7
  genss           1.6.9                        ARTIFACTS/3bd5aa8.../genss-1.6.9
  guava           3.19        v300.1900.0+0    ARTIFACTS/d0c29f2.../guava-3.19
  io              4.9.1       v400.900.100+1   ARTIFACTS/d502c7d.../io-4.9.1
  irredsol        1.4.4                        ARTIFACTS/a9f1d45.../irredsol-1.4.4
* juliainterface  0.13.0-DEV  v0.1300.1+0      /export/home/sam/julia/packages/GAP.jl/pkg/JuliaInterface
  laguna          3.9.7                        ARTIFACTS/8497297.../laguna-3.9.7
  orb             4.9.1       v400.900.100+1   ARTIFACTS/d2699bc.../orb-4.9.1
* oscarinterface  1.3.0-DEV                    /export/home/sam/julia/packages/Oscar.jl/gap/OscarInterface
  packagemanager  1.6                          ARTIFACTS/da27160.../PackageManager-1.6
  polenta         1.3.10                       ARTIFACTS/1c64565.../polenta-1.3.10
  polycyclic      2.16                         ARTIFACTS/19ffad5.../polycyclic-2.16
  primgrp         3.4.4                        ARTIFACTS/f21a1e0.../primgrp-3.4.4
  radiroot        2.9                          ARTIFACTS/320d3c9.../radiroot-2.9
  recog           1.4.3                        ARTIFACTS/e6cd9b6.../recog-1.4.3
  repsn           3.1.2                        ARTIFACTS/94e5135.../repsn-3.1.2
  resclasses      4.7.3                        ARTIFACTS/9cc64af.../resclasses-4.7.3
  smallgrp        1.5.4                        ARTIFACTS/051592b.../SmallGrp-1.5.4
  sonata          2.9.6                        ARTIFACTS/d31bd16.../sonata-2.9.6
  sophus          1.27                         ARTIFACTS/4c406cd.../sophus-1.27
  spinsym         1.5.2                        ARTIFACTS/9949383.../spinsym-1.5.2
  standardff      1.0                          ARTIFACTS/28827b6.../StandardFF-1.0
  tomlib          1.2.11                       ARTIFACTS/5cbbd05.../tomlib-1.2.11
  transgrp        3.6.5                        ARTIFACTS/0308e77.../transgrp
  utils           0.85                         ARTIFACTS/d43af8a.../utils-0.85
  wedderga        4.10.5                       ARTIFACTS/4fec3f3.../wedderga-4.10.5

The longest line of this table is 107 characters wide.
If we change the layout such that two lines per package are shown, we would lose the appearance as a table but the information would fit into an 80 character terminal.

@lgoettgens
Copy link
Member

I would vote for GAP.versioninfo as that's a bit briefer to type and thus to get users to enter (that's for me the main application: when helping to debug a user's problem, ask them to report the output of GAP.versioninfo() )

We could event keep GAP.Packages.versioninfo() mostly like this (but without the GAP version) and have GAP.versioninfo() print the GAP version and call the other function. (Just some spontaneous idea, no deeper thought about it yet)

- change `GAP.Packages.versioninfo`:
  do not show the GAP version, show GAP packages (versions and paths)
  and jll packages in separate lists, similar to Oscar's `versioninfo`,
- do not show `*` in the beginning of the lines for those packages
  whose paths are nonstandard,
- add `GAP.versioninfo` that shows also the GAP (and GAP_jll) version,
- introduce keyword arguments for including jll and GAP information,
- document `GAP.versioninfo` not `GAP.Packages.versioninfo`.
@lgoettgens
Copy link
Member

julia> GAP.versioninfo()
ERROR: BoundsError: attempt to access 0-element Vector{Pkg.API.PackageInfo} at index [1]
Stacktrace:
 [1] throw_boundserror(A::Vector{Pkg.API.PackageInfo}, I::Tuple{Int64})
   @ Base ./essentials.jl:14
 [2] getindex
   @ ./essentials.jl:916 [inlined]
 [3] versioninfo(io::Base.TTY; jll::Bool, padding::String)
   @ GAP ~/code/julia/GAP.jl/src/GAP.jl:338
 [4] versioninfo(io::Base.TTY)
   @ GAP ~/code/julia/GAP.jl/src/GAP.jl:336
 [5] top-level scope
   @ REPL[2]:1

src/GAP.jl Outdated Show resolved Hide resolved
src/GAP.jl Outdated Show resolved Hide resolved
- show the jll version for all installed packages
  not only for the loaded ones, since the jlls are loaded
- add `full` argument for `GAP.versioninfo`, like in Oscar
- add a test
Copy link
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three more comments, otherwise looks great from my POV. Thanks!

src/GAP.jl Outdated Show resolved Hide resolved
src/GAP.jl Show resolved Hide resolved
test/basics.jl Outdated Show resolved Hide resolved
@lgoettgens

This comment was marked as resolved.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@fingolfin fingolfin merged commit 2ea7715 into oscar-system:master Jan 9, 2025
161 checks passed
@ThomasBreuer ThomasBreuer deleted the TB_versioninfo branch January 9, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GAP.versioninfo() showing a list of loaded GAP packages (including version, package installation path)
3 participants